<?php

namespace app\api\validate;

use think\Validate;

/**
 * 用户验证类
 */
class UserValidate extends Validate
{

    protected $rule = [
        'username' => 'require',
        'password' => 'require',
        'key' => 'require|in:sex,nickname,thumb',
        'value' => 'require',
    ];

    protected $message = [
        'username.require' => '账号不能为空',
        'password.require' => '密码不能为空',
    ];

    protected $scene = [
        //登录
        'login' => ['username', 'password'],
        'save' => ['key', 'value'],

    ];
}